"""bbs2 URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path,re_path
from app01 import views
from django.views.static import serve
from bbs2 import settings
urlpatterns = [
    path('admin/', admin.site.urls),
    path('up_or_down/',views.up_or_down),
    path('register/',views.register,name='reg'),
    path('login/',views.login,name='login'),
    path('get_code/',views.get_code ,name='gc'),
    path('home/',views.home ),
    path('set_password/',views.set_password ,name='set_password'),
    path('logout/',views.logout ,name='logout'),
    re_path(r'media/(?P<path>.*)',serve,{'document_root':settings.MEDIA_ROOT}),
    path('set_img/',views.set_img, name='set_img'),

    re_path(r'^(?P<username>\w+)/$',views.site ,name='user'),
    re_path(r'^(?P<username>\w+)/(?P<condition>category|tag|archive)/(?P<param>.*)/',views.site),
    re_path(r'^(?P<username>\w+)/article/(?P<article_id>\d+)/',views.article)

]
